/*
package com.panshi.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Slf4j
public class JwtInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        String token = request.getHeader("token");
        if(token == null){
            return false;
        }
        log.info("--------------JwtInterceptor--------------token{}----",token);
        try{
            Claims claims = JwtUtil.parseJWT(token);
            System.out.println(claims.getId());
            System.out.println(claims.getSubject());
            System.out.println(claims.getExpiration());
            System.out.println(claims.get("username"));
            System.out.println(claims.get("username", String.class));
            return true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return false;
    }
}
*/
